Correct installation to follow standards
authorBen Longbons <b.r.longbons@gmail.com>
Tue, 24 Jun 2014 18:10:27 +0000 (11:10 -0700)
committerBen Longbons <b.r.longbons@gmail.com>
Tue, 24 Jun 2014 18:10:27 +0000 (11:10 -0700)
.travis.yml
Makefile

index c43ad30f5557a40320df591e43eb2a90555b2666..b921ca20dc2a38ba1be4df4a6f029b92dd518883 100644 (file)
@@ -7,6 +7,7 @@ script:
   - ./.travis.check.style.sh
   - make CC="$CC" RUSTC="$RUSTC" -j4
   - make CC="$CC" RUSTC="$RUSTC" test -j4
+  - make install DESTDIR=${PWD}/destdir
 
 env:
   - ARCH=i686 CC='cc -m32'
index 057a5e7a70452b28f18707fe116ed282e69d39c8..ede17f22bc8396a59f31df1cd1c498410f73c72f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
 RUSTC ?= rustc
 RUSTC_FLAGS ?=
-DESTDIR ?= /usr/local
+DESTDIR ?=
+PREFIX ?= /usr/local
+BINDIR ?= $(PREFIX)/bin
 
 # Link flags to pull in dependencies
 BINS = cargo \
@@ -75,7 +77,8 @@ distclean: clean
        cd libs/toml-rs && make clean
 
 install:
-       cp target/cargo target/cargo-* $(DESTDIR)/bin
+       install -d $(DESTDIR)$(BINDIR)
+       install target/cargo target/cargo-* $(DESTDIR)$(BINDIR)
 
 # Setup phony tasks
 .PHONY: all clean distclean test test-unit test-integration libcargo